Skip to content

Add durable session handoff packages#23

Merged
ThomsenDrake merged 4 commits intomainfrom
chore/session-handoff-packages
Mar 25, 2026
Merged

Add durable session handoff packages#23
ThomsenDrake merged 4 commits intomainfrom
chore/session-handoff-packages

Conversation

@ThomsenDrake
Copy link
Copy Markdown
Owner

@ThomsenDrake ThomsenDrake commented Mar 25, 2026

Summary

  • add a durable session handoff/checkpoint export and import path under op-tauri
  • preserve objective, open questions, candidate actions, evidence index, replay span, and provenance-friendly refs in a stable artifact
  • document the handoff contract and expose minimal frontend invoke/types glue

Verification

  • cargo test -p op-tauri handoff
  • npm test -- src/api/invoke.test.ts

Notes

  • import persists and surfaces checkpoints for review/resume, but does not yet wire checkpoint_ref into future turns
  • handoffs are single-snapshot exports, not multi-turn range packages yet

Open with Devin

devin-ai-integration[bot]

This comment was marked as resolved.

@ThomsenDrake
Copy link
Copy Markdown
Owner Author

@codex

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa8f538e5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +133 to +135
let session_dir = sessions_dir(&state).await.join(&session_id);
if !session_dir.is_dir() {
return Err(format!("Session '{session_id}' not found"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject traversal in export session_id

export_session_handoff builds session_dir by directly joining untrusted session_id to the sessions root and only checks is_dir(). A value like "../../Documents" will pass if that directory exists, and the command then writes a handoff artifact under that escaped path (artifacts/handoffs/...). This allows writing outside the managed sessions tree, which is a filesystem integrity/security issue for any caller that can invoke this command.

Useful? React with 👍 / 👎.

Comment on lines +377 to +380
if let Some(session_id) = target_session_id {
let session_dir = sessions_root.join(session_id);
if !session_dir.is_dir() {
return Err(format!("Target session '{session_id}' not found"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Sanitize target_session_id before import path join

resolve_import_target accepts target_session_id verbatim, joins it to sessions_root, and treats any existing directory as valid. With path traversal segments (for example "../../../tmp"), import_handoff_into_session will then write artifacts/handoffs/*.json and metadata.json into that escaped directory. This permits unintended file writes outside the session store and should be blocked by validating IDs (or enforcing canonical-path containment).

Useful? React with 👍 / 👎.

@ThomsenDrake ThomsenDrake merged commit 306ee56 into main Mar 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant